
public class MessageParser
{
	private Logic logic;
	private Message message;
	
	public String[] read(String _string)
	{
		{
			System.out.println("Received message!");
			System.out.println(_string);
			
		}
		if (_string == null | _string.split(" ").length < 3)
			return null;
		message = new Message();
		message.setSender(_string.split(" ")[0]);
		_string.replaceFirst(message.getSdr(), "");
		message.setCommand(_string.split(" ")[0]);
		_string.replaceFirst(message.getCmd(), "");
		message.setParams(_string);
		
		return logic.handle(message);
	}
}
